package com.jjh.jhwebserver.core;

/**
 * JhWebServer服务器总体
 * @author JJH
 */
public class JhWebServer {

    private static ServletContext servletContext;

    private static ServerSocketHandler serverSocketHandler;


    /**
     * 直接启动
     * @param appName
     */
    public static ServletContext  run(String appName){
       servletContext = new ServletContext(appName);
       serverSocketHandler = new ServerSocketHandler(servletContext);
       return servletContext;
    }

    /**
     * 修改端口启动
     * @param appName
     * @param port
     */
    public static ServletContext run(String appName,int port){
        servletContext = new ServletContext(appName);
        serverSocketHandler = new ServerSocketHandler(servletContext,port);
        return servletContext;
    }



}
